package cn.afterturn.svn.analysis.controller.historyinfo;

import org.nutz.dao.QueryResult;
import org.nutz.dao.pager.Pager;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.slf4j.Logger;

import cn.afterturn.svn.analysis.entity.historyinfo.HistoryInfoEntity;
import cn.afterturn.svn.analysis.service.historyinfo.HistoryInfoService;

/**
 *  SVN 历史查询
 * @author JueYue
 * @date 2015-07-29 15:39
 * @version V1.0  
 */
@At("historyinfo.htm")
public class HistoryInfoController {

    private static final Log LOGGER = Logs.get();

    @Inject
    private HistoryInfoService historyInfoService;

    @At
    @Ok("jsp:historyinfo/historyInfoList")
    public void home(HistoryInfoEntity entity) {
    }

    @At("historyinfo_list.htm")
    @Ok("json")
    public QueryResult HistoryInfoList(HistoryInfoEntity entity, Pager pager) {
        QueryResult list = null;
        try {
            list = historyInfoService.getHistoryInfoPage(entity, pager);
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return list;
    }
}
